package net.zjitc.controller;

import net.zjitc.pojo.Student;
import net.zjitc.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.xml.ws.RequestWrapper;
import java.util.List;

@Controller
public class StuentController {
    @Autowired
    StudentService studentService;

    @RequestMapping(value = "/findAll")
    public String findAll(Model model){
        List<Student> list = studentService.findAll();
        model.addAttribute("list",list);
        return "/info.jsp";
    }

    @RequestMapping(value = "/add")
    public String add(Student user){
        System.out.println();
        return "/info.jsp";
    }
}
